#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const int N = 1e5 + 5;
const int M = 998244353;

int t, n;
string s;

ll fac[N], ifac[N];

ll inv(ll a, ll p = M)
{
    return (a == 1) ? 1 : inv(p % a, p) * (p - p / a) % p;
}

// a/b % p
ll frac_inv(ll a, ll b, ll p = M)
{
    return ((a % p) * inv(b, p)) % p;
}

void init()
{
    fac[0] = ifac[0] = 1;
    for (int i = 1; i < N; i++) {
        fac[i] = fac[i - 1] * i % M;
        ifac[i] = inv(fac[i]);
    }
}
int main()
{
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    init();

    cin >> t;
    int sum0, sum2;
    while (t--)
    {
        cin >> n >> s;
        sum0 = sum2 = 0;

        for (int i = 0; i < n; i++)
        {
            if (s[i] == '0')
                sum0++;

            else if (s[i] == '1' && i + 1 < n && s[i + 1] == '1')
                sum2++, i++;
        }

        ll ans = fac[sum2 + sum0] * ifac[sum2] % M;
        ans = ans * ifac[sum0] % M;

        cout << ans << endl;
    }
    return 0;
}